﻿
using Shared.Domain;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ProductManagement.Domain
{

    /// <summary>
    /// 子商品
    /// </summary>
    public class ProChild : LongEntityOnlyDelete
    {
        public ProChild() { }

        public Product Product { get; private set; }

        public long ProductId { get; private set; }

        [MaxLength(500)]
        public string Image { get; private set; }


        public int Stock { get; private set; }
        public int SellCount { get; private set; } = 0;
        public decimal RetailPrice { get; private set; } = 0;
        public decimal Price { get; private set; } = 0;
        //public string SKU { get; private set; }

        /// <summary>
        /// 导航属性-具体规格
        /// </summary>
        public List<ProChildSpec> SpecResultItems { get; private set; } = new List<ProChildSpec>();

        public ProChild(string img, int stock, int sellCount, decimal retailPrice, decimal price)
        {
            this.Image = img;
            this.SellCount = sellCount;
            this.Stock = stock;
            this.Price = price;
            this.RetailPrice = retailPrice;
            this.IsDeleted = false;

        }
    }


}
